package edu.cque.sp04.feign;

import edu.cque.sp01.entity.User;
import edu.cque.sp01.web.util.JsonResult;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Hua
 * @create 2022-08-18 16:06
 */
@FeignClient(value = "user-service", contextId = "userClient")
public interface UserClient {

    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable("userId") Integer userId);

    @GetMapping("/{userId}/score") //score?score=1000   子路径.
    JsonResult<?> addScore(@PathVariable("userId") Integer userId,@RequestParam("score") Integer score);
}
